package com.example.demo.service.impl;

import com.example.demo.mapper.StatisticMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class StatisticService implements com.example.demo.service.StatisticService {

    @Autowired
    StatisticMapper statisticMapper;

    @Override
    public int setCommentsNumByArticleId(Integer articleId) {
        return statisticMapper.setCommentsNumByArticleId(articleId);
    }

    @Override
    public int getHitsByArticleId(Integer articleId) {
        return statisticMapper.getHitsByArticleId(articleId);
    }

    @Override
    public int setHitsByArticleId(Integer hits, Integer articleId) {
        return statisticMapper.setHitsByArticleId(hits,articleId);
    }

    @Override
    public int insertStatistic(Integer articleId, Integer hits, Integer commentsNum) {
        return statisticMapper.insertStatistic(articleId,hits,commentsNum);
    }

    @Override
    public int deleteStatisticByArticleId(Integer articleId) {
        return statisticMapper.deleteStatisticByArticleId(articleId);
    }

}
